| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

UserType.h
1 // UserType.h
3 //
5
6 namespace nkScripts
7 {
8 using ConstructorCallback = std::function<void*(const DataStack&)> ;
9 using DestructorCallback = std::function<void(void*)> ;
10 }
11
12 namespace nkScripts
13 {
26 class UserType
27 {
28 public :
29
35 UserType (nkMemory::StringView name) noexcept ;
39 virtual ~UserType () ;
40
41 // Getters
45 nkMemory::StringView getName () const ;
49 nkMemory::StringView getFullName () const ;
54 virtual Function* getMethod (nkMemory::StringView name) = 0 ;
59 virtual Function* getStaticMethod (nkMemory::StringView name) = 0 ;
60
67 virtual void setConstructor (ConstructorCallback constructor) = 0 ;
74 virtual void setDestructor (DestructorCallback destructor) = 0 ;
87 virtual Function* addMethod (nkMemory::StringView name, bool strongReferenceOverThis = false) = 0 ;
94 virtual Function* addStaticMethod (nkMemory::StringView name) = 0 ;
101 virtual Function* overrideBuiltInFunction (TYPE_BUILT_IN_FUNCTIONS builtInFunc) = 0 ;
107 virtual void addField (const UserTypeFieldDescriptor& fieldDescriptor) = 0 ;
113 virtual void enableArrayIndexing (const ArrayAccessorDescriptor& descriptor) = 0 ;
117 virtual void reset () = 0 ;
118 } ;
119 }
nkScripts
Encompasses all API of component NilkinsScripts.
Definition: Environment.h:7
nkScripts::UserType::addStaticMethod
virtual Function * addStaticMethod(nkMemory::StringView name)=0
nkMemory::BufferView
A view over data.
Definition: BufferView.h:18
nkScripts::UserType::getMethod
virtual Function * getMethod(nkMemory::StringView name)=0
nkScripts::UserType::setDestructor
virtual void setDestructor(DestructorCallback destructor)=0
nkScripts::UserType::enableArrayIndexing
virtual void enableArrayIndexing(const ArrayAccessorDescriptor &descriptor)=0
nkScripts::UserType::addField
virtual void addField(const UserTypeFieldDescriptor &fieldDescriptor)=0
nkScripts::DestructorCallback
std::function< void(void *)> DestructorCallback
Callback function signature for a destructor.
Definition: UserType.h:9
nkScripts::ConstructorCallback
std::function< void *(const DataStack &)> ConstructorCallback
Callback function signature for a constructor.
Definition: UserType.h:8
nkScripts::UserType
Represents a user type and all the information and control related.
Definition: UserType.h:27
nkScripts::UserType::addMethod
virtual Function * addMethod(nkMemory::StringView name, bool strongReferenceOverThis=false)=0
nkScripts::UserType::UserType
UserType(nkMemory::StringView name) noexcept
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkScripts::UserType::setConstructor
virtual void setConstructor(ConstructorCallback constructor)=0
nkScripts::UserType::getName
nkMemory::StringView getName() const
nkScripts::UserType::reset
virtual void reset()=0
nkScripts::UserType::getFullName
nkMemory::StringView getFullName() const
nkScripts::UserType::~UserType
virtual ~UserType()
nkScripts::ArrayAccessorDescriptor
Holds information about the way to access a user type as an array.
Definition: ArrayAccessorDescriptor.h:15
nkScripts::Function
Holds information, and controls, over a function in a scripting environment.
Definition: Function.h:50
nkScripts::UserType::overrideBuiltInFunction
virtual Function * overrideBuiltInFunction(TYPE_BUILT_IN_FUNCTIONS builtInFunc)=0
nkScripts::UserType::getStaticMethod
virtual Function * getStaticMethod(nkMemory::StringView name)=0
nkScripts::UserTypeFieldDescriptor
Holds all the information required to define a field.
Definition: UserTypeFieldDescriptor.h:15
nkScripts::TYPE_BUILT_IN_FUNCTIONS
TYPE_BUILT_IN_FUNCTIONS
Available overridable built in functions.
Definition: TypeBuiltInFunctions.h:12